using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MKDS_Course_Editor
{
    public partial class HexEditor : Form
    {
        string file;
        public HexEditor(string file)
        {
            InitializeComponent();
            this.file = file;
        }

        private void HexEditor_Load(object sender, EventArgs e)
        {
            hexBox1.ByteProvider = new Be.Windows.Forms.FileByteProvider(file);
        }

        private void HexEditor_FormClosing(object sender, FormClosingEventArgs e)
        {
            Be.Windows.Forms.FileByteProvider f = (Be.Windows.Forms.FileByteProvider)hexBox1.ByteProvider;
            f.Dispose();
        }

        private void toolStripSplitButton1_Click(object sender, EventArgs e)
        {
            hexBox1.ByteProvider.ApplyChanges();
        }
    }
}
